<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title></title>
		<link rel="stylesheet" type="text/css" href="../../../resource/css/bootstrap.min.css"/>
		<link rel="stylesheet" type="text/css" href="../../../resource/css/jedate.css"/>
		<link rel="stylesheet" type="text/css" href="../../../resource/fonts/iconfont.css"/>
		<link rel="stylesheet" type="text/css" href="../../../resource/css/common.css"/>
		<link rel="stylesheet" type="text/css" href="../../../../resources/layui/css/layui.css"/>
		<style type="text/css">
			.erp-txt .col-xs-3,.erp-txt .col-xs-9{padding: 0;}
			.erp-txt2{background: #FFF;overflow: hidden;}
			.erp-txt span,
			.visa-txt .sp{width: 100px;}
			.visa-txt span.divCon{
				width:calc(100% - 100px);
				/*Firefox*/
				width: -moz-calc(100% - 100px);
				/*chrome safari*/
				width: -webkit-calc(100% - 100px);
			}
			.layui-input, .layui-textarea{
				display: inline-block;width: 70%;
			}
		</style>
	</head>
	<body>
		<div class="container-fluid con-sch">
			<div class="row mheader">
				<div class="col-xs-2 text-left"><a href="javascript:;" onclick="javascript:history.back(-1);"><span class="iconfont icon-fanhui"></span></a></div>
				<div class="col-xs-8"><h2>合同进度查询详情</h2></div>
				<div class="col-xs-2 bianji"><h2>编辑</h2></div>

			</div>
			<div class="row main">

			</div>
			<!--编辑-->
			<div class="search-box">
				<div class="search-cover">
					<span class="deteleC"><i class="iconfont icon-shanchu"></i></span>
					<form action="" method="post">
						<div class="row sign-peo">
							<div class="sign-peoper">
							<p><span>签收人：</span><input type="text" name="cc_recperson" class="" value="" /></p>
							<p style="margin-top: 10px;"><span>送达时间：</span><input type="text" class="layui-input" id="gtime" name="cc_rectime" placeholder="送达时间"></p>
							</div>
						</div>
						
						<div class="order-send"><a href="###" class="btn btn-warning">确定</a></div>
						
					</form>
				</div>	
			
			</div>
		</div>
	</body>
</html>
<script src="https://cdn.bootcss.com/jquery/2.2.4/jquery.min.js"></script>
<script src="../../../resource/js/bootstrap.min.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../resource/js/jquery.jedate.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../resource/js/style.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../../resources/layui/layui.js"></script>

<script>
	$(function () {

		ajaxs('api/contract/loadContractDetails.do','post',{'uuid':sessionStorage.uuid},function (data) {
			console.log(data);
			var das0=data.data[0][0];
            var das1=data.data[1][0];
            var das2=data.data[2][0];
            sessionStorage.ccuid=das0.cc_UUID;
            if(das0.cc_vali!=1){
			    $('.bianji').hide();
			}

            var gongchenggaikuo='';
            console.log(data.data)
			if (das0.c_type && das0.c_type === 1){
                gongchenggaikuo = das0.c_build;
                das0.gcfy = das0.c_price;
			}else {
                for(var i=0;i<data.data[2].length;i++){
                    gongchenggaikuo+=data.data[2][i].cc_cname;
                    gongchenggaikuo+=':';
                    gongchenggaikuo+=data.data[2][i].cc_cnum+'('+data.data[2][i].cc_cbit+')';
                    gongchenggaikuo+='&nbsp;&nbsp;&nbsp;&nbsp;';
                }
			}

			if(!das0.gcfy){
                das0.gcfy='';
			}

            var gongC='';
            for(var i=0;i<data.data[2].length;i++){
                gongC+=data.data[2][i].cc_cname+','+data.data[2][i].cc_cprice+','+data.data[2][i].cc_cnum+data.data[2][i].cc_cbit+','+'&nbsp;&nbsp;'
            }

            switch (das0.state){
				case 0:
                    das0.state='审核通过';
                    break;
                case 1:
                    das0.state='等待审核';
                    break;
                case -1:
                    das0.state='审核未通过';
                    break;

            }
            $('.main').append('<dl class="erp-list erp-details">' +
                '<dd>' +
                '<div class="erp-txt visa-txt">' +
					'<p><span>合同编号:</span>'+das0.cc_Code+'</p>' +
					'<p class="clearfix"><span class="sp">项目名称:</span><span class="divCon">'+das0.eppName+'('+das0.eppStaEnd+')'+'</span></p>' +
					'<p class="clearfix"><span class="sp">起止点:</span><span class="divCon">'+das0.eppStaEnd+'</span></p>' +
					'<p class="clearfix"><span class="sp">施工单位:</span><span class="divCon">'+das0.compName1+'</span></p>' +
                	'<p class="clearfix"><span class="sp">项目负责人:</span><span class="divCon">'+das0.compPerson1+'</span></p>' +
                	'<p><span>联系方式:</span>'+das0.compTel1+'</p>' +
					'<p class="clearfix"><span class="sp">建设单位:</span><span class="divCon">'+das0.compJs+'</span></p>' +
                '</div>' +
                '</dd>' +
                '<dd>' +
                '<div class="erp-txt visa-txt">' +
                '<p><span>计划开工日期:</span>'+shijians(das0.preStaTime)+'</p>' +
                '<p><span>计划竣工日期:</span>'+shijians(das0.preEndTime)+'</p>' +
                '<p class="clearfix"><span class="sp">委托设计单位:</span><span class="divCon">'+das0.compName0+'</span></p>' +
                '<p class="clearfix"><span class="sp">项目负责人:</span><span class="divCon">'+das0.compPerson0+'</span></p>' +
                '<p><span>联系方式:</span>'+das0.compTel0+'</p>' +
                '</div>' +
                '</dd>' +
                '' +
                '</dl>' +
                '' +
                '<dl class="erp-list visa-details">' +
                '<dd>' +
                '<div class="erp-txt visa-txt">' +
                '<p class="clearfix">' +
                '<span class="sp">工程概括:</span>' +
                '<span class="divCon">'+gongchenggaikuo+'</span>' +
                '</p>' +
                '<p class="clearfix">' +
                '<span class="sp">合同单价:</span>' +
                '<span class="divCon">'+das0.cc_Price+'</span>' +
                '</p>' +
                '<p class="clearfix">' +
                '<span class="sp">工程费用:</span>' +
                '<span class="divCon">'+das0.gcfy+'</span>' +
                '</p>' +
                '<p class="clearfix">' +
                '<span class="sp">决算方式:</span>' +
                '<span class="divCon">'+das0.cc_CostType+'</span>' +
                '</p>' +
                '<p class="clearfix">' +
                '<span class="sp">材料供应:</span>' +
                '<span class="divCon">'+das0.cc_Material+'</span>' +
                '</p>' +
                '<p class="clearfix">' +
                '<span class="sp">工程质量:</span>' +
                '<span class="divCon">'+das0.cc_BuildMass+'</span>' +
                '</p>' +
                '<p class="clearfix">' +
                '<span class="sp">安全施工:</span>' +
                '<span class="divCon">'+das0.cc_Security+'</span>' +
                '</p>' +
                '<p class="clearfix">' +
                '<span class="sp">文明/环保施工:</span>' +
                '<span class="divCon">'+das0.cc_Culture+'</span>' +
                '</p>' +
                '<p class="clearfix">' +
                '<span class="sp">竣工验收:</span>' +
                '<span class="divCon">'+das0.cc_FinVe+'</span>' +
                '</p>' +
                '<p class="clearfix">' +
                '<span class="sp">质保期限:</span>' +
                '<span class="divCon">'+das0.cc_WarrantyTime+'</span>' +
                '</p>' +
                '<p class="clearfix">' +
                '<span class="sp">其他:</span>' +
                '<span class="divCon">'+das0.cc_Other+'</span>' +
                '</p>' +
                '<p><span>审核状态:</span>'+das0.state+'</p>' +

                '</div>' +
                '</dd>' +
                '' +
                '</dl>' +
                '<dl class="erp-list erp-details">' +
                '<dd>' +
                '<div class="erp-txt visa-txt">' +
                '<p class="clearfix"><span class="sp">建设单位(甲方):</span><span class="divCon">'+das0.compJs+'</p></span>' +
                '<p class="clearfix"><span class="sp">委托代理人:</span><span class="divCon">'+das0.compPerson0+'</p></span>' +
                '<p><span>日期:</span>'+shijians(das0.sign_Time)+'</p>' +
                '</div>' +
                '</dd>' +
                '<dd>' +
                '<div class="erp-txt visa-txt">' +
                '<p class="clearfix"><span class="sp">施工单位(乙方):</span><span class="divCon">'+das0.compName1+'</p></span>' +
                '<p class="clearfix"><span class="sp">委托代理人:</span><span class="divCon">'+das0.compPerson1+'</p></span>' +
                '<p><span>日期:</span>'+shijians(das0.preEndTime)+'</p>' +
                '</div>' +
                '</dd>' +
                '' +
                '</dl>')
        })
    })
	//选择时间
    layui.use(['form', 'layedit', 'laydate','table','laytpl','flow'], function() {
        var laydate = layui.laydate;

        laydate.render({
            elem: '#gtime'
            ,type: 'datetime'
        });
        laydate.render({
            elem: '#gtime1'
            ,type: 'datetime'
        });
    })


	//点击改变申请单高度
	$(document).ready(function(){
		  $(".more").click(function(){
		    $(this).siblings(".order-li").toggleClass("orderHeight");
		  });
	});
	$(".edit").click(function(){
		$(".search-box").slideDown();
	});
	$(".deteleC").click(function(){
		$(".search-box").slideUp();
	})

	var arr=getCookie('yanzheng');
	arr=arr.split('|');

	$('.bianji').click(function () {
		$('.search-box').show();
		$('[name="cc_recperson"]').val(arr[0]);
    })

	$('.btn').click(function () {
		if($('[name="cc_recperson"]').val().length<1||$('[name="cc_rectime"]').val().length<1){
            window.tool.alert('请输入必填信息');
			return;
        }
        ajaxs('api/contract/editBuilProcess.do','post',{'cc_recperson':$('[name="cc_recperson"]').val(),'cc_rectime':$('[name="cc_rectime"]').val(),'p':getP(),'cc_uuid':sessionStorage.ccuid},function (data) {
			console.log(data)
            window.tool.alert(data.msg);
			if(data.code==0){
			    location.href='./erp-list.html';
			}
        })

    })

</script>











